import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:online_study/home/banner_item.dart';
import 'package:online_study/home/home_message_item.dart';
import 'package:online_study/home/home_recommend_item.dart';
import 'package:online_study/home/home_search_item.dart';
import 'package:online_study/home/home_special_item.dart';
import 'package:online_study/home/special/special_list.dart';
import 'package:online_study/theme/colors.dart';
import 'package:online_study/theme/size.dart';
import 'package:online_study/theme/string.dart';

//首页
class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          backgroundColor: ThemeColor.colorWhite,
          elevation: ThemeSize.appElevation,
          title: HomeSearchPage(),
        ),
        body: SingleChildScrollView(
          child: Column(
            children: [
              HomeBanner(),
              HomeMessage(),
              Container(
                margin: EdgeInsets.symmetric(vertical: ThemeSize.height12),
                padding: EdgeInsets.symmetric(horizontal: ThemeSize.width9),
                child: Row(
                  children: [
                    Container(
                        height: ThemeSize.height12,
                        child: VerticalDivider(color: ThemeColor.color1485EE,thickness: ThemeSize.width2)
                    ),
                    Text(ThemeString.recommend,style: TextStyle(color: ThemeColor.color333333,fontSize: ThemeSize.sp13)),
                  ],
                ),
              ),
              HomeRecommend(),
              Container(
                margin: EdgeInsets.symmetric(vertical: ThemeSize.height12),
                padding: EdgeInsets.symmetric(horizontal: ThemeSize.width9),
                child:Row(
                  children: [
                    Container(
                        height: ThemeSize.height12,
                        child: VerticalDivider(
                            color: ThemeColor.color1485EE,
                            thickness: ThemeSize.width2)),
                    Expanded(
                        child: Text(ThemeString.special,
                            style: TextStyle(
                                color: ThemeColor.color333333,
                                fontSize: ThemeSize.sp13))),
                    GestureDetector(
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: [
                          Text("专题列表",
                              style: TextStyle(
                                  color: ThemeColor.color808080,
                                  fontSize: ThemeSize.sp13)),
                          Container(
                              margin: EdgeInsets.only(right: ThemeSize.width9),
                              child: Icon(
                                  const IconData(0xe631,
                                      fontFamily: 'IconFonts'),
                                  size: ThemeSize.height12))
                        ],
                      ),
                      onTap: () {
                        Get.to(() => SpecialListPage());
                      },
                    )
                  ],
                ),
              ),
              HomeSpecial(),
            ],
      ),
    ));
  }
}
